import collections


class Solution(object):
    def isReflected(self, points):
        """
        :type points: List[List[int]]
        :rtype: bool
        """
        d = collections.defaultdict(int)
        total = 0
        count = 0
        for point in points:
            if not d[tuple(point)]:
                d[tuple(point)] = 1
                total += point[0]
                count += 1
        x = total / count
        for point in points:
            one = tuple(point)
            other = (int(2 * x) - point[0], point[1])
            if not (d[one] and d[other]):
                return False
        return True


data = Solution()
points = [[1, 1]]
print(data.isReflected(points))
points = [[-16, 1], [16, 1], [16, 1]]
print(data.isReflected(points))
points = [[1, 1], [-1, 1]]
print(data.isReflected(points))
points = [[1, 1], [-1, -1]]
print(data.isReflected(points))
